/*
 * @Descripttion: 
 * @version: 
 * @Author: ydj
 * @Date: 2025-04-09 11:23:55
 * @LastEditors: ydj
 * @LastEditTime: 2025-04-09 14:30:42
 */
import React from 'react';
import { Map, APILoader } from '@uiw/react-baidu-map';
import "./style.scss";

interface IMapProps {
    lng: number;
    lat: number;
    zoom?: number;
}
const BaiduMap: React.FC<IMapProps> = (props) => {
    const { lng, lat, zoom = 15 } = props;
    return (
        <div className='map'>
            <APILoader akay="WektHR3Afa9ThdHYwlXQL0l1XImqPi7b" version="2.0">
                <Map
                    widget={['NavigationControl', 'ScaleControl']}
                    center={{ lng, lat }}
                    zoom={zoom}
                    enableScrollWheelZoom
                    enableDragging
                    enableDoubleClickZoom
                >
                </Map>
            </APILoader>
        </div>
    );
};

export default BaiduMap;